package com.ljf.daily.makemoneydetail.dto.command;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ljf.common.validation.AddGroup;
import com.ljf.common.validation.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 赚钱明细记录--新增修改  daily_dat_make_money_detail
 *
 * @author LJF
 * @since 2024-01-19
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("赚钱明细记录--新增修改")
public class DailyDatMakeMoneyDetailCommand implements Serializable {

    @JsonProperty("id")
    @ApiModelProperty(value = "ID")
    @NotNull(message = "ID不能为空", groups = UpdateGroup.class)
    private Long id;

    @JsonProperty("softwareCode")
    @ApiModelProperty(value = "归属赚钱软件编码")
    @Length(message = "归属赚钱软件编码长度不能超过12个字符", max = 12)
    @NotNull(message = "归属赚钱软件编码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String softwareCode;

    @JsonProperty("withdrawalCount")
    @ApiModelProperty(value = "提现统计")
    @NotNull(message = "提现统计不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Digits(integer = 6, fraction = 2, message = "提现统计最多只允许6位整数2位小数")
    private BigDecimal withdrawalCount;

    @JsonProperty("belongDate")
    @ApiModelProperty(value = "归属时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @NotNull(message = "归属时间不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Date belongDate;

    @JsonProperty("remark")
    @ApiModelProperty(value = "备注")
    @Length(message = "备注长度不能超过20个字符", max = 20)
    private String remark;

    @JsonProperty("type")
    @ApiModelProperty(value = "类型")
    private Integer type;

    @JsonProperty("withdrawalCountList")
    @ApiModelProperty(value = "提现统计(集合)")
    private String withdrawalCountList;

    @JsonProperty("softwareAutoCode")
    @ApiModelProperty(value = "编码")
    private String softwareAutoCode;

}
